﻿using DataAccess.Entities;
using FluentNHibernate.Mapping;

namespace DataAccess.Mappings
{
    public class EventMap : ClassMap<Event>
    {
        public EventMap()
        {
            Id(x => x.Id);
            Map(x => x.Title);
            Map(x => x.Description);
            Map(x => x.StartTime);
            Map(x => x.EndTime);
            References(x => x.Owner);
            Map(x => x.Location);
            HasMany(x => x.Categories).Inverse().Cascade.All();
        }
    }
}
